Ch(k) Grammars: A Characterization of LL(k) Languages

نویسندگان

  • Anton Nijholt
  • Eljas Soisalon-Soininen
چکیده

From the point of view of parsing the LL(K] grammars constitute a very attractive class of context-free grammars. For each LL{K] grammar a top-down parsing algorithm can be devised which is essentially a one-state deterministic push-down automaton. From a more theoretiG point of view LL[K) grammars are attractive as well. It is well-known, for example, that it is decidable whether two LLfk) grammars are equivalent. Also the hierarchy of LL[K) languages with regard to the length k of the look-ahead is a characteristic property. The class of LL[k] grammars is properly contained in the class of LR[K] grammars, and even the family of LLCK) languages is properly contained in the family of LR(K) languages. If we focus on the "gap" between LL~K) and LR[K] grammars the following points are of interest, [i] There is the obvious difference in grammar definition. (ii) The generating capacities are different. (iii) Apart From the difference between LR[O) and LR(1) languages the length k of the look-ahead does not play a role for LR[K] languages. [iv] Every LL(K] grammar is both left parsable and right parsable but there are LR[K] grammars which are not left parsable [i]. We consider the present paper as a contribution to the research which tries to clarify the differences between LL(K) and LR[K) grammars. Research in this area has been reported e. paper we introduce the class of so called Ch[K] grammars [pronounced "chain K grammars"]. This class of grammars is properly contained in the class of LR(K] grammars and it properly contains the LL(K] grammars. However, the family of Ch[K] languages coincides with the family of LL(K] languages. Nevertheless, the parsing properties of Ch[K] grammars are quite different from the parsing properties of LL~KI grammars. The class of Ch[K) grammars can be considered as a generalization of the class of simple chain grammars [6] in the same sense as the class of LL[K] grammars is a generalization of the class of simple LL[I] grammars. The present paper is organized as follows. In Section 2 we define the necessary 391 background concerning context-free ~rammars and parsing. The Ch[K) grammars are

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Top-down Deterministic Languages

Two new families of languages, the F(k) and U(k) languages, are Introduced each of which is, in some sense, a generalization of top-down deterministic languages. This leads us to new characterizations of s-grammars and LL(1) languages. We include a characterization of the unambiguous context-free languages, generalizations of the equivalence relation on s-grammars to LL(k) grammars, and a summa...

متن کامل

The Equivalence Problem for LL- and LR-Regular Grammars

Questions whether or not two grammars belonging to a family of grammars generate the same language have extensively been studied in the literature. These problems are called equivalence problems and if there exists an algorithm which for each pair of grammars of this family gives an answer to this question then the equivalence problem for this family of grammars is said to be decidable. Otherwi...

متن کامل

Expressive Power of LL(k) Boolean Grammars

The paper studies the family of Boolean LL languages, generated by Boolean grammars and usable with the recursive descent parsing. It is demonstrated that over a one-letter alphabet, these languages are always regular, while Boolean LL subsets of Σ∗a∗ obey a certain periodicity property, which, in particular, makes the language {anb2n | n > 0} non-representable. It is also shown that linear con...

متن کامل

Simple Chain Grammars and Languages

A subclass of the LR(O)-grammars, the class of simple chain grammars is introduced. Although there exist simpio chain grammars which are not LL(k) for any k > 0, this new class of grammars is very closely related to the LL(1) and simple LL(1) grammars. In fact it can be shown that every simple chain grammar has an equivalent simple LL(1) grammar. Cover properties for simple chain grammars are i...

متن کامل

Undecidable problems concerning densities of languages

In this paper we prove that the question whether a language presented by a context free grammar has density, is undecidable. Moreover we show that there is no algorithm which, given two unambiguous context free grammars on input, decides whether the language defined by the first grammar has a relative density in the language defined by the second one. Our techniques can be extended to show that...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1979